package com.bckj.fastboot.iot.api.service;

import com.bckj.fastboot.core.lang.model.PageResult;
import com.bckj.fastboot.iot.common.constant.IotConstants;
import com.bckj.fastboot.iot.common.dto.query.IotAlarmRuleQuery;
import com.bckj.fastboot.iot.common.dto.request.IotAlarmRuleRequest;
import com.bckj.fastboot.iot.common.dto.response.IotAlarmRuleResponse;
import com.bckj.fastboot.iot.common.entity.IotAlarmRule;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * IotAlarmRuleRemoteService
 *
 * @author wfc
 **/
@FeignClient(value = IotConstants.SERVICE_ID, contextId = "iotAlarmRule", path = "iotAlarmRule")
public interface IotAlarmRuleRemoteService {


    @PostMapping()
    boolean save(@RequestBody IotAlarmRuleRequest request);

    @PutMapping()
    boolean update(@RequestBody IotAlarmRuleRequest request);

    @DeleteMapping("/{id}")
    boolean remove(@PathVariable Long id);

    @GetMapping("/{id}")
    IotAlarmRuleResponse details(@PathVariable Long id);

    @GetMapping("/page")
    PageResult<IotAlarmRuleResponse> page(@SpringQueryMap IotAlarmRuleQuery query);

    @GetMapping("/findRules")
    List<IotAlarmRule> findRules(@RequestParam String protocolCode, @RequestParam String cmd);
}
